package cn.tedu.boot01.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BMIController {

    @RequestMapping("/bmi")
    public String bmi(Double height, Double weight) {
        double result = weight / (height * height);
        if (result <= 18.5) {
            return "兄弟你瘦了";
        }
        if (result <= 24) {
            return "身体很棒";
        }
        if (result <= 27) {
            return "微微胖";
        }
        return "要减肥了";

    }
}
